{{include file="header.html"}}
<body class="regi_body">
    <div class="regi_header">
        <a href="javascript:">培育计划申报</a>
    </div>
    <div class="register">
        <div class="bule_bg">
            <div>修改密码</div>
        </div>
        <form action="index.php?app=Index" method="post" onsubmit="return false" class="ajaxSubmit">
            <div class="content">
                <table>
                    <!-- <tr>
                        <td>姓名</td>
                        <td><input type="text" name="username"></td>
                        <td class="info">请输入真实姓名</td>
                    </tr> -->
                    <tr>
                        <td>原始密码</td>
                        <td><input type="password" name="old_password"></td>
                        <td class="info">请输入该账号的原始密码</td>
                    </tr>
                    <tr>
                        <td>新密码</td>
                        <td>
                            <input type="password" name="password">
                        </td>
                        <td class="info">密码由6-20位的英文字母、数字和特殊符号组成</td>
                    </tr>
                    <tr>
                        <td>确定密码</td>
                        <td>
                            <input type="password" name="password2">
                        </td>
                        <td class="info">请再次填写一遍密码，以辅助检测密码输入是否正确</td>
                    </tr>
                </table>
                <div class="go_login"><a href="index.php?app=Index&act=index">啊，不想修改密码了，返回主页面</a></div>
                <button onclick="alter();">确定</button>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        function alter(){
            var params = $("form").serialize();
            $.post('{{"index.php?app=Index&alter"|URL}}',params,function(result){
                if(result.statusCode=='200'){
                    ui.success(result.message);
                    setTimeout(function(){
                        var url = "{{$smarty.const.__PROJECT__}}Index/index";
                        document.location.href = url;
                    },1000);
                }else if(result.statusCode=='300')
                $("input[name='"+result.message.name+"']").parent().parent().find(".info").addClass("info_w").html(result.message.message);
            },'json');
        }
    </script>
</body>
</html>